<?php
namespace Custom\Controller;
use Think\Controller;
use \Mobile\Model\xcx;

class GetnumController extends UserController
{
    
    function __construct()
    {
        parent::__construct();
        $this->c_id = session('c_id');
        $this->M_get_num = M('Get_num');
    }
    
    public function index()
    {   
        
        $where['s_id'] = $this->s_id;     
        $data = M('Table_cate')->where($where)->select();
        foreach ($data as $k => &$v) {
            $key = 'number'.$v['s_id'].'-'.$v['table_cate_id'];
            $v['tabList'] = S($key);
           
        }       
 
        $this->assign('info',$data);
        $this->display();
    }

    public function is_eat(){
        $number = I('number');
        $sid = $this->s_id;
        $typeId = I('typeId');

        $key = 'number'.$sid.'-'.$typeId;
        $list = S($key);

        foreach ($list as $k => $v) {
            if($v == $number){
                unset($list[$k]);
            }
        }
        S($key,$list);
        $xcx =  new xcx($sid);
        $user = S($key.'bindUser');
        $xcx->sendTemplateMsg1($user['fid'],$number,$user['openid']);
    }

   

}